import junit.framework.TestCase;

import org.junit.Test;


public class TestDebitCard extends TestCase{
	

	@Test
	public void test() {

		Person p1 = new Person("testAccount1", "street1", "zip1", "town1", "country1");
		Person p2 = new Person("testAccount2", "street2", "zip2", "town2", "country2");
		Person p3 = new Person("testAccount3", "street3", "zip3", "town3", "country3");
		Person p4 = new Person("testAccount4", "street4", "zip4", "town4", "country4");
		
		DebitCard d1  = new DebitCard(p1);
	    DebitCard d2  = new DebitCard(p2);
	    DebitCard d3  = new DebitCard(p3, 6, 
	                        new CheckingAccount(p3, 0 ,1000));
	    DebitCard d4  = new DebitCard(p4, 6, 
	    			        new CheckingAccount(p4, 0 ,2000));
	        
		assertEquals("d1 not created", d1.getName(), "testAccount1");
		assertEquals("d2 not created", d2.getName(), "testAccount2");
		
//		assertTrue("d3 not created", d3.getAccountNum() == 3);
		assertEquals("d3 not created", d3.getName(), "testAccount3");
//		assertTrue("d3 not created", d3.getCheckAcctNum() == 0);
		
//		assertTrue("d4 not created", d4.getAccountNum() == 4);
		assertEquals("d4 not created", d4.getName(), "testAccount4");
//		assertTrue("d4 not created", d4.getCheckAcctNum() == 1);
		
		assertTrue("d3 test pay not working", d3.pay(100));
		assertTrue("d4 test pay not working", d4.pay(200));
	
// 		assertTrue("d2 not created", d2.getAccountNum() == 2);
//		assertTrue("d3 not created", d3.getAccountNum() == 3);

		
	}

}
